package com.milotnt.utils;

import org.springframework.stereotype.Component;

import java.util.Calendar;
import java.util.Random;

@Component
public class RandomUtil {

    public Integer getAccount(){
        Random random = new Random();
        // 开头使用当前的年份
        Calendar calendar = Calendar.getInstance();
        int pre = calendar.get(Calendar.YEAR);
        StringBuilder account1 = new StringBuilder(String.valueOf(pre));
        for (int i = 0; i < 5; i++) {
            account1.append(random.nextInt(10));
        }
        return Integer.parseInt(account1.toString());
    }
}
